home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / graphics / raytracing / blackscr.lha / BlackScreen.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-22  |  1.3 KB  |  59 lines

  1. /* Blackscreen.c - Rob Freundlich */
  2.  
  3. /* This program is hereby released to the world at large.  Do whatever you want with it. */
  4.  
  5. #include <stdio.h>
  6.  
  7. #include <dos/dos.h>
  8. #include <exec/types.h>
  9. #include <intuition/intuition.h>
  10. #include <intuition/screens.h>
  11.  
  12. #include <clib/dos_protos.h>
  13. #include <clib/exec_protos.h>
  14. #include <clib/intuition_protos.h>
  15.  
  16. struct Library *IntuitionBase;
  17.  
  18. int main()
  19. {
  20.     struct Screen *s;
  21.     struct ColorSpec cspec[] = {
  22.         {0,0,0,0},
  23.         {0,0,0,0},
  24.         {-1,0,0,0},
  25.     };
  26.     struct Window *w;
  27.  
  28.     if (IntuitionBase = OpenLibrary("intuition.library",37)) {
  29.         if (s = OpenScreenTags(NULL,
  30.                 SA_Depth,1,
  31.                 SA_Colors, cspec,
  32.                 TAG_DONE)) {
  33.             if (w = OpenWindowTags(NULL,
  34.                     WA_CustomScreen,    s,
  35.                     WA_Left,    0,
  36.                     WA_Top,        0,
  37.                     WA_Width,        s->Width,
  38.                     WA_Height,    s->Height,
  39.                     WA_Flags,        WFLG_BORDERLESS|WFLG_CLOSEGADGET,
  40.                     WA_IDCMP,        IDCMP_CLOSEWINDOW,
  41.                     TAG_DONE)) {
  42.                 struct IntuiMessage *msg;
  43.  
  44.                 WaitPort(w->UserPort);
  45.                 msg = (struct IntuiMessage *)GetMsg(w->UserPort);
  46.                 ReplyMsg((struct Message *)msg);
  47.                 CloseWindow(w);
  48.             }
  49.             else printf("Couldn't open window.\n");
  50.             CloseScreen(s);
  51.         }
  52.         else printf("Couldn't open screen.\n");
  53.         CloseLibrary(IntuitionBase);
  54.     }
  55.     else printf("Couldn't open intuition.library v37\n");
  56.     return 0;
  57. }
  58.  
  59.